from PyQt5.QtWidgets import QApplication, QWidget, QLineEdit, QVBoxLayout
from PyQt5.QtCore import *
from PyQt5.QtGui import QIcon
import sys


def init_widget(w: QWidget):
    # 修改窗口标题
    w.setWindowTitle('单行输入框')
    # 设置窗口大小
    w.resize(480, 320)
    edit = QLineEdit()
    edit.setParent(w)



if __name__ == '__main__':
    # 1.创建应用程序
    app = QApplication(sys.argv)
    # 2.创建窗口
    w = QWidget()
    init_widget(w)
    # 3.显示窗口
    w.show()
    # 4.等待窗口停止
    sys.exit(app.exec())